layout = input("Transliterate to ru or en?: ")
if layout == 'ru':
    text = input("Paste your text here:\n")

    # Lower case
    text = text.replace('q','й')
    text = text.replace('w','я')
    text = text.replace('e','у')
    text = text.replace('r','к')
    text = text.replace('t','е')
    text = text.replace('y','н')
    text = text.replace('u','г')
    text = text.replace('i','ш')
    text = text.replace('o','щ')
    text = text.replace('p','з')
    text = text.replace('a','ф')
    text = text.replace('s','ы')
    text = text.replace('d','в')
    text = text.replace('f','а')
    text = text.replace('g','п')
    text = text.replace('h','р')
    text = text.replace('j','о')
    text = text.replace('k','л')
    text = text.replace('l','д')
    text = text.replace('z','я')
    text = text.replace('x','ч')
    text = text.replace('c','с')
    text = text.replace('v','м')
    text = text.replace('b','и')
    text = text.replace('n','т')
    text = text.replace('m','ь')
    text = text.replace('[','х')
    text = text.replace(']','ъ')
    text = text.replace(';','ж')
    text = text.replace(',','б')
    text = text.replace('.','ю')
    text = text.replace('/','.')
    text = text.replace("'","э")
    text = text.replace('`','ё')

    # Upper case
    text = text.replace('Q','Й')
    text = text.replace('W','Я')
    text = text.replace('E','У')
    text = text.replace('R','К')
    text = text.replace('T','Е')
    text = text.replace('Y','Н')
    text = text.replace('U','Г')
    text = text.replace('I','Ш')
    text = text.replace('O','Щ')
    text = text.replace('P','З')
    text = text.replace('A','Ф')
    text = text.replace('S','Ы')
    text = text.replace('D','В')
    text = text.replace('F','А')
    text = text.replace('G','П')
    text = text.replace('H','Р')
    text = text.replace('J','О')
    text = text.replace('K','Л')
    text = text.replace('L','Д')
    text = text.replace('Z','Я')
    text = text.replace('X','Ч')
    text = text.replace('C','С')
    text = text.replace('V','М')
    text = text.replace('B','И')
    text = text.replace('N','Т')
    text = text.replace('M','Ь')
    text = text.replace('{','Х')
    text = text.replace('}','Ъ')
    text = text.replace(':','Ж')
    text = text.replace('<','Б')
    text = text.replace('>','Ю')
    text = text.replace('?',',')
    text = text.replace('"','Э')
    text = text.replace('~','Ё')
    text = text.replace('@','"')
    text = text.replace('#','№')
    text = text.replace('$',';')
    text = text.replace('^',':')
    text = text.replace('&','?')
    text = text.replace('|','/')

    print("\nRU text:\n",text,sep='')

elif layout == 'en':
    text = input("Paste your text here:\n")

    # Lower case
    text = text.replace('й','q')
    text = text.replace('я','w')
    text = text.replace('у','e')
    text = text.replace('к','r')
    text = text.replace('е','t')
    text = text.replace('н','y')
    text = text.replace('г','u')
    text = text.replace('ш','i')
    text = text.replace('щ','o')
    text = text.replace('з','p')
    text = text.replace('ф','a')
    text = text.replace('ы','s')
    text = text.replace('в','d')
    text = text.replace('а','f')
    text = text.replace('п','g')
    text = text.replace('р','h')
    text = text.replace('о','j')
    text = text.replace('л','k')
    text = text.replace('д','l')
    text = text.replace('я','z')
    text = text.replace('ч','x')
    text = text.replace('с','c')
    text = text.replace('м','v')
    text = text.replace('и','b')
    text = text.replace('т','n')
    text = text.replace('ь','m')
    text = text.replace('х','[')
    text = text.replace('ъ',']')
    text = text.replace('ж',';')
    text = text.replace('б',',')
    text = text.replace('ю','.')
    text = text.replace('.','/')
    text = text.replace("э","'")
    text = text.replace('ё','`')

    # Upper case
    text = text.replace('Й','Q')
    text = text.replace('Я','W')
    text = text.replace('У','E')
    text = text.replace('К','R')
    text = text.replace('Е','T')
    text = text.replace('Н','Y')
    text = text.replace('Г','U')
    text = text.replace('Ш','I')
    text = text.replace('Щ','O')
    text = text.replace('З','P')
    text = text.replace('Ф','A')
    text = text.replace('Ы','S')
    text = text.replace('В','D')
    text = text.replace('А','F')
    text = text.replace('П','G')
    text = text.replace('Р','H')
    text = text.replace('О','J')
    text = text.replace('Л','K')
    text = text.replace('Д','L')
    text = text.replace('Я','Z')
    text = text.replace('Ч','X')
    text = text.replace('С','C')
    text = text.replace('М','V')
    text = text.replace('И','B')
    text = text.replace('Т','N')
    text = text.replace('Ь','M')
    text = text.replace('Х','{')
    text = text.replace('Ъ','}')
    text = text.replace('Ж',':')
    text = text.replace('Б','<')
    text = text.replace('Ю','>')
    text = text.replace(',','?')
    text = text.replace('Э','"')
    text = text.replace('Ё','~')
    text = text.replace('"','@')
    text = text.replace('№','#')
    text = text.replace(';','$')
    text = text.replace(':','^')
    text = text.replace('?','&')
    text = text.replace('/','|')

    print("\nEN text:\n",text,sep='')

else:
    print("Error!")
